<?php

use app\assets\UserLoginAsset;
use yii\helpers\Html;

/**
 * @var $this yii\web\View
 * @var $model app\models\UserLoginForm
 */

UserLoginAsset::register($this);

$this->title = '用户登录';
?>
<?php $this->beginPage();?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta charset="<?= Yii::$app->charset ?>">
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
    <meta name="description" content="用户登录" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
</head>
<?php $this->beginBody() ?>
<body>
<div class="container">
    <div class="form row">
        <div class="form-horizontal col-md-offset-3" id="login_form">
            <h3 class="form-title" style="color: white">星澜物联管理平台</h3>
            <h4 class="header red lighter bigger" style="color: white">
                <?php if (!empty($model->errors)) {
                    $errors = $model->errors;
                    $error = array_pop($errors);
                    echo $error[0];
                } else {
                    echo '请输入您的登录信息';
                }?>
            </h4>
            <?php echo Html::beginForm(['/user/login'], 'post', ['id'=>'login-form']);?>
            <div class="col-md-9">
                <div class="form-group">
                    <i class="fa fa-user fa-lg"></i>
                    <?php echo Html::activeTextInput($model, 'username', ['class' => 'form-control', 'placeholder' => '登录账号']);?>
                </div>
                <div class="form-group">
                    <i class="fa fa-lock fa-lg"></i>
                    <?php echo Html::activePasswordInput($model, 'password', ['class' => 'form-control', 'placeholder' => '登录密码']);?>
                </div>
                <div class="form-group">
                    <label class="inline">
                        <?php echo Html::checkbox(Html::getInputName($model, 'rememberMe'), $model->rememberMe == 1, ['class' => 'ace']);?>
                        <span class="lbl" style="color: white"> 记住登录状态</span>
                    </label>
                </div>
                <div class="form-group col-md-offset-9">
                    <button type="submit" class="btn btn-success pull-right" name="submit">登录</button>
                </div>
            </div>
            <?php echo Html::endForm();?>
        </div>
    </div>
</div>
</body>
<?php $this->endBody() ?>
</html>
<?php $this->endPage() ?>
